function setCanvasStyle(map, canvas_size, speed = 0.5) {
  // speed每20毫秒变化的像素数
  let canvas = document.createElement("canvas");
  let ctx = canvas.getContext("2d");
  canvas.width = canvas_size;
  canvas.height = canvas_size;
  /* 设置半径,和中心点坐标 */
  let x = canvas_size / 2;
  let y = canvas_size / 2;
  let radiusIn = canvas_size / 4;
  let radiusOut = canvas_size / 2;
  let radius = radiusIn;
  /* 绘制 */
  let increase = true;
  /* 25~35 */
  function draw() {
    ctx.clearRect(0, 0, canvas.width, canvas.height);
    ctx.beginPath();
    ctx.arc(x, y, radius, 0, Math.PI * 2);
    ctx.closePath();
    ctx.fillStyle = "#ff2d51";
    ctx.fill();
    if (radius > radiusOut) {
      increase = false;
    } else if (radius < radiusIn) {
      increase = true;
    }
    if (increase) {
      radius += speed;
    } else {
      radius -= speed;
    }
    setTimeout(draw, 20);
    /* render */
    map.render(); // 如果不手动渲染，那只能在拖动和缩放的时候才能自动重新渲染
  }
  draw();
  /* 设置canvas元素为openlayers的样式 */
  let style = new ol.style.Style({
    image: new ol.style.Icon({
      img: canvas,
      imgSize: [canvas.width, canvas.height],
      //   imgSize: [canvas.width / 2, canvas.height / 2],
    }),
  });
  return style;
}
